import 'package:flutter/material.dart';

class LoadingProgress extends StatelessWidget {
  final Widget child;
  final bool isLoading;
  final bool cover;
  const LoadingProgress({Key? key, required this.child, required this.isLoading,  this.cover=false}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return !cover
          ? !isLoading ?child:_loading()
          :Stack(children: [child,! isLoading ?Container():_loading()]
          );
  }

  _loading() {
    return const Center(
      child: CircularProgressIndicator(),
    );
  }
}
